TY (12)CL1993>MYROM *************************************** * BOZO'S PROGRAM CRACKER ROM * * REVISION 1.1 * *************************************** * * NOTE: THIS PGM WILL NOT WORK UNLESS 'TO', 'FROM', AND 'STOP' ALL EQUATE TO * PAGE BOUNDRIES (E.G. 2000, 4400, ETC) * ***************************************************************************** * THE BASIS OF THIS LITTLE PROGRAM IS THE USE OF ABSOLUTE INDEXED INCREMENT * * ADDRESSING (E.G. LDA 400,X STA 2400,X INX). TO KEEP THE LENGTH AS * * SHORT AS POSSIBLE, SELF-MODIFYING CODE IS USED. THE ABSOLUTE INDEXING * * MODE CAN ONLY MOVE 1 PAGE AT A TIME, THE SELF-MODIFICATION PART ALLOWS * * ONE TO MOVE MORE THAN 1 PAGE, WITHOUT HAVING TO DUPLICATE THE CODE OVER & * * AND OVER FOR EACH PAGE ($FF BYTES). SINCE SELF-MODIFYING CODE MUST BE * * RAM BASED, THE FIRST PART OF THIS PGM MOVES THE SECOND PART FROM ROM * * INTO RAM; IT THEN JUMPS TO THE BEGINNING OF THE CODE IT JUST MOVED....... * * !!!!! WARNING !!!!! NOTE THAT MOST ASSEMBLERS WILL CODE THE: LDA FROM,X * * INCORRECTLY WHEN FROM EQUATES IN THE ZERO PAGE; THIS WILL RESULT IN TWO * * OP-CODES BEING GENERATED INSTEAD OF THREE, AND WILL MESS UP THE SELF- * * MODIFYING PART. THIS SOURCE IS MEANT MOSTLY AS AN AID TO UNDERSTANDING; * * USE THE OBJECT CODE WHICH FOLLOWS, WHEN MODIFYING YOUR F8 MONITOR. * * --------------->BOZO<----------------------------->NYC<------------------ * ******************----*******************************---********************* * * ORG $FCC9 ;THIS IS THE TAPE WRITE SECTION OF F8 ROM * ;AND THE BEGINNING OF ROM BASED CODE FROM EQU $0000 ;BEGINNING OF MEMORY TO SAVE TO EQU $2000 ;LOCATION TO BEGIN SAVING CODE STOP EQU $2800 ;LOCATION + 1 TO STOP SAVING CODE CODE EQU $2800 ;BEGINNING OF RELOCATED (RAM) BASED CODE RESET EQU $FF59 * ;!!! PROGRAM START !!! CLD LDX #0 LOOP1 LDA MOVE,X STA CODE,X INX CPX #$1B ;LENGTH OF ROM CODE TO MOVE BNE LOOP1 JMP CODE MOVE LDY #/STOP LDX #0 LOOP2 LDA FROM,X STA TO,X INX BNE LOOP2 INC CODE+6 INC CODE+9 CPY CODE+9 BNE LOOP2 JMP RESET END HERE'S THE ASSEMBLED OBJECT, READY TO DROP IN AT $FCC9. THIS IS THE ONE OF THE TAPE WRITE ROUTINES IN THE F8 ROM; SINCE I DON'T USE TAPE, AND I WANTED TO PRESERVE THE ROM ROUTINES, I CHOSE THIS LOCATION. IF YOU WANT TO LOCATE IT SOMEWHERE ELSE, FEEL FREE, BUT BEWARE THAT IT IS NOT RELOCATABLE WITHOUT A FEW CHANGES. FCC9: D8 A2 00 BD DA FC 9D 00 FCD1: 28 E8 E0 1B D0 F5 4C 00 FCD9: 28 A0 28 A2 00 BD 00 00 FCE1: 9D 00 20 E8 D0 F7 EE 06 FCE9: 28 EE 09 28 CC 09 28 D0 FCF1: EC 4C 59 FF HAVE FUN (?)